package com.longchat.domain.system;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the T_ROLE database table.
 * 
 */
@Entity
@Table(name="T_ROLE")
@NamedQuery(name="Role.findAll", query="SELECT r FROM Role r")
public class Role implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="T_ROLE_ID_GENERATOR" )
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="T_ROLE_ID_GENERATOR")
	@Column(unique=true, nullable=false, precision=22)
	private long id;

	@Column(name="CREATE_ID", precision=22)
	private BigDecimal createId;

	@Temporal(TemporalType.DATE)
	@Column(name="CREATE_TIME")
	private Date createTime;

	@Column(name="ROLE_DESC", length=200)
	private String roleDesc;

	@Column(name="ROLE_NAME", length=50)
	private String roleName;

	@Column(length=1)
	private String status;

	@Column(name="UPDATE_ID", precision=22)
	private BigDecimal updateId;

	@Temporal(TemporalType.DATE)
	@Column(name="UPDATE_TIME")
	private Date updateTime;

	//bi-directional many-to-many association to User
	@ManyToMany(mappedBy="TRoles")
	private List<User> TUsers;

	//bi-directional many-to-many association to Menu
	@ManyToMany
	@JoinTable(
		name="T_ROLE_PRIVI"
		, joinColumns={
			@JoinColumn(name="ROLE_ID", nullable=false)
			}
		, inverseJoinColumns={
			@JoinColumn(name="MENU_ID", nullable=false)
			}
		)
	private List<Menu> TMenus;

	public Role() {
	}

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public BigDecimal getCreateId() {
		return this.createId;
	}

	public void setCreateId(BigDecimal createId) {
		this.createId = createId;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getRoleDesc() {
		return this.roleDesc;
	}

	public void setRoleDesc(String roleDesc) {
		this.roleDesc = roleDesc;
	}

	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public BigDecimal getUpdateId() {
		return this.updateId;
	}

	public void setUpdateId(BigDecimal updateId) {
		this.updateId = updateId;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public List<User> getTUsers() {
		return this.TUsers;
	}

	public void setTUsers(List<User> TUsers) {
		this.TUsers = TUsers;
	}

	public List<Menu> getTMenus() {
		return this.TMenus;
	}

	public void setTMenus(List<Menu> TMenus) {
		this.TMenus = TMenus;
	}

}